<template>
  <div>
      <t-dialog header="自定义标签" :visible="bodyVisible3" :footer="false" :onClose="bodyClose2">
        <div slot="body">
              <t-form :data="formData" ref="form" @reset="onReset" @submit="onSubmit" :colon="true">
                <t-form-item label="自定义标签" name="tag">
                    <t-input v-model="formData.tag" placeholder="请输入标签"></t-input>
                </t-form-item>
                <t-form-item style="padding-top: 8px">
                    <t-button theme="primary" type="submit" style="margin-right: 10px">提交</t-button>
                    <t-button theme="default" variant="base" type="reset">重置</t-button>
                </t-form-item>
            </t-form>
        </div>
      </t-dialog>
  </div>
</template>

<script>

const INITIAL_DATA = {
  tag: '',
};
export default {
    data() {
        return {
            formData: { ...INITIAL_DATA },
            bodyVisible3: false, 
        }
    },
    methods: {
        onSubmit () {
            // 提交
            this.$message.success('定义成功')
            this.bodyVisible3 = false;
            this.$emit('tag', this.formData.tag)
        },

        onReset () {
            // 重置
            this.$message.success('重置成功');
        },

        bodyClose2 () {
            this.bodyVisible3 = false;
        }
    }
}
</script>

<style>

</style>